﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Web.View.z00_kcxxMenu.Default" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>z00_kcxx</title>
    <script src="/View/js/Alert.js" type="text/javascript"></script> 
    <script type="text/javascript">
        function SetWinData(index) {
            document.getElementById("Hid").value = z00_kcxx_MainStore.getAt(index).get('ksid');
            
			Txtypid.setValue(z00_kcxx_MainStore.getAt(index).get('ypid'));
			Txtypgg.setValue(z00_kcxx_MainStore.getAt(index).get('ypgg'));
			Txtcjid.setValue(z00_kcxx_MainStore.getAt(index).get('cjid'));
			Txtscph.setValue(z00_kcxx_MainStore.getAt(index).get('scph'));
			Txtlsjg.setValue(z00_kcxx_MainStore.getAt(index).get('lsjg'));
			Txtpfjg.setValue(z00_kcxx_MainStore.getAt(index).get('pfjg'));
			Txtgsid.setValue(z00_kcxx_MainStore.getAt(index).get('gsid'));
			Txtjldw.setValue(z00_kcxx_MainStore.getAt(index).get('jldw'));
			Txtsqsl.setValue(z00_kcxx_MainStore.getAt(index).get('sqsl'));
			Txtkcsl.setValue(z00_kcxx_MainStore.getAt(index).get('kcsl'));
			Txtlsj1.setValue(z00_kcxx_MainStore.getAt(index).get('lsj1'));
			Txtlsj2.setValue(z00_kcxx_MainStore.getAt(index).get('lsj2'));
			Txtlsj3.setValue(z00_kcxx_MainStore.getAt(index).get('lsj3'));
			Txtsxrq.setValue(z00_kcxx_MainStore.getAt(index).get('sxrq'));
			Txtbjrq.setValue(z00_kcxx_MainStore.getAt(index).get('bjrq'));
			Txtfjhm.setValue(z00_kcxx_MainStore.getAt(index).get('fjhm'));
			Txthjhm.setValue(z00_kcxx_MainStore.getAt(index).get('hjhm'));
			Txthjch.setValue(z00_kcxx_MainStore.getAt(index).get('hjch'));
			Txthjwh.setValue(z00_kcxx_MainStore.getAt(index).get('hjwh'));
			Txtsxbz.setValue(z00_kcxx_MainStore.getAt(index).get('sxbz'));
			Txtyxbz.setValue(z00_kcxx_MainStore.getAt(index).get('yxbz'));
			Txtdjbz.setValue(z00_kcxx_MainStore.getAt(index).get('djbz'));
			Txtfphm.setValue(z00_kcxx_MainStore.getAt(index).get('fphm'));
			Txtpzwh.setValue(z00_kcxx_MainStore.getAt(index).get('pzwh'));
			Txtxzbz.setValue(z00_kcxx_MainStore.getAt(index).get('xzbz'));
			Txtsj.setValue(z00_kcxx_MainStore.getAt(index).get('sj'));
			TxtNumgmp.setValue(z00_kcxx_MainStore.getAt(index).get('gmp'));
			TxtNumzbbz.setValue(z00_kcxx_MainStore.getAt(index).get('zbbz'));
			Txtscpc.setValue(z00_kcxx_MainStore.getAt(index).get('scpc'));

            z00_kcxx_Win.show();
        }
    </script>
</head>
<body>
    <form id="MainForm" runat="server">
    <ext:ResourceManager ID="MainResourceMgr" runat="server" />
    <!--用来导出到Excel的数据源-->
    <ext:Hidden ID="ExcelGridData" runat="server" />
    <!--z00_kcxx表页面主数据元，自动生成-->
    <ext:Store runat="server" ID="z00_kcxx_MainStore" OnRefreshData="z00_kcxx_DataBind" AutoLoad="true">
        <Proxy>
            <ext:PageProxy />
        </Proxy>
        <Reader>
            <ext:JsonReader IDProperty="ksid">
                <Fields>
                    
					<ext:RecordField Name="ksid" />
					<ext:RecordField Name="ypid" />
					<ext:RecordField Name="ypgg" />
					<ext:RecordField Name="cjid" />
					<ext:RecordField Name="scph" />
					<ext:RecordField Name="lsjg" />
					<ext:RecordField Name="pfjg" />
					<ext:RecordField Name="gsid" />
					<ext:RecordField Name="jldw" />
					<ext:RecordField Name="sqsl" />
					<ext:RecordField Name="kcsl" />
					<ext:RecordField Name="lsj1" />
					<ext:RecordField Name="lsj2" />
					<ext:RecordField Name="lsj3" />
					<ext:RecordField Name="sxrq" />
					<ext:RecordField Name="bjrq" />
					<ext:RecordField Name="fjhm" />
					<ext:RecordField Name="hjhm" />
					<ext:RecordField Name="hjch" />
					<ext:RecordField Name="hjwh" />
					<ext:RecordField Name="sxbz" />
					<ext:RecordField Name="yxbz" />
					<ext:RecordField Name="djbz" />
					<ext:RecordField Name="fphm" />
					<ext:RecordField Name="pzwh" />
					<ext:RecordField Name="xzbz" />
					<ext:RecordField Name="sj" />
					<ext:RecordField Name="gmp" />
					<ext:RecordField Name="zbbz" />
					<ext:RecordField Name="scpc" />

                </Fields>
            </ext:JsonReader>
        </Reader> 
        <BaseParams>
            <ext:Parameter Name="start" Value="0" Mode="Raw">
            </ext:Parameter>
            <ext:Parameter Name="limit" Value="15" Mode="Raw">
            </ext:Parameter>
        </BaseParams>
    </ext:Store>
    <!--z00_kcxx页面主表格-->
    <ext:Viewport ID="MainViewPort" runat="server">
        <Items>
            <ext:FitLayout>
                <Items>
                    <ext:GridPanel ID="z00_kcxx_Grid" Layout="fit" TrackMouseOver="true" runat="server" StoreID="z00_kcxx_MainStore"
                        StripeRows="true" Header="false" Border="false" Collapsible="true">
                        <TopBar>
                            <ext:Toolbar ID="MainToolBar" runat="server">
                                <Items>
                                    <ext:Button ID="BtnAdd" runat="server" Text="添加" Icon="Add">
                                        <Listeners>
                                            <Click Handler="#{z00_kcxx_MainForm}.getForm().reset();#{Hid}.setValue('');#{z00_kcxx_Win}.show();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:Button ID="BtnDel" runat="server" Text="删除" Icon="Delete">
                                        <DirectEvents>
                                            <Click OnEvent="BtnDel_Click">
                                                <Confirmation ConfirmRequest="true" Title="确认" Message="确实要删除吗?" />
                                                <EventMask ShowMask="true" Msg="正在删除数据，请等候 ..." />
                                            </Click>
                                        </DirectEvents>
                                        <Listeners>
                                            <Click Handler="if(#{z00_kcxx_Grid}.getSelectionModel().getCount()<=0) {TellAlert('请选择要删除的记录');return false;}" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarSeparator />
                                    <ext:Button ID="BtnReload" runat="server" Text="重新加载" Icon="Reload">
                                        <Listeners>
                                            <Click Handler="#{z00_kcxx_MainStore}.reload();" />
                                        </Listeners>
                                    </ext:Button>
                                    <ext:ToolbarFill />
                                    <ext:Button ID="BtnToExcel" runat="server" Text="To Excel" AutoPostBack="true" OnClick="BtnSaveToExcel"
                                        Icon="PageExcel">
                                        <Listeners>
                                            <Click Handler="#{ExcelGridData}.setValue(Ext.encode(z00_kcxx_Grid.getRowsValues(false)));" />
                                        </Listeners>
                                        <ToolTips>
                                            <ext:ToolTip Title="将当前页内容存储为Excel文件">
                                            </ext:ToolTip>
                                        </ToolTips>
                                    </ext:Button>
                                </Items>
                            </ext:Toolbar>
                        </TopBar>
                        <ColumnModel ID="z00_kcxx_ColumnMode" runat="server">
                            <Columns>
                                <ext:RowNumbererColumn Width="20" />
                                <ext:Column Header="主键" Sortable="true" Hidden="true" DataIndex="ksid" />
                                
								<ext:Column Header="ypid" Sortable="true" DataIndex="ypid" />
								<ext:Column Header="ypgg" Sortable="true" DataIndex="ypgg" />
								<ext:Column Header="cjid" Sortable="true" DataIndex="cjid" />
								<ext:Column Header="scph" Sortable="true" DataIndex="scph" />
								<ext:Column Header="lsjg" Sortable="true" DataIndex="lsjg" />
								<ext:Column Header="pfjg" Sortable="true" DataIndex="pfjg" />
								<ext:Column Header="gsid" Sortable="true" DataIndex="gsid" />
								<ext:Column Header="jldw" Sortable="true" DataIndex="jldw" />
								<ext:Column Header="sqsl" Sortable="true" DataIndex="sqsl" />
								<ext:Column Header="kcsl" Sortable="true" DataIndex="kcsl" />
								<ext:Column Header="lsj1" Sortable="true" DataIndex="lsj1" />
								<ext:Column Header="lsj2" Sortable="true" DataIndex="lsj2" />
								<ext:Column Header="lsj3" Sortable="true" DataIndex="lsj3" />
								<ext:Column Header="sxrq" Sortable="true" DataIndex="sxrq" />
								<ext:Column Header="bjrq" Sortable="true" DataIndex="bjrq" />
								<ext:Column Header="fjhm" Sortable="true" DataIndex="fjhm" />
								<ext:Column Header="hjhm" Sortable="true" DataIndex="hjhm" />
								<ext:Column Header="hjch" Sortable="true" DataIndex="hjch" />
								<ext:Column Header="hjwh" Sortable="true" DataIndex="hjwh" />
								<ext:Column Header="sxbz" Sortable="true" DataIndex="sxbz" />
								<ext:Column Header="yxbz" Sortable="true" DataIndex="yxbz" />
								<ext:Column Header="djbz" Sortable="true" DataIndex="djbz" />
								<ext:Column Header="fphm" Sortable="true" DataIndex="fphm" />
								<ext:Column Header="pzwh" Sortable="true" DataIndex="pzwh" />
								<ext:Column Header="xzbz" Sortable="true" DataIndex="xzbz" />
								<ext:Column Header="sj" Sortable="true" DataIndex="sj" />
								<ext:Column Header="gmp" Sortable="true" DataIndex="gmp" />
								<ext:Column Header="zbbz" Sortable="true" DataIndex="zbbz" />
								<ext:Column Header="scpc" Sortable="true" DataIndex="scpc" />

                            </Columns>
                        </ColumnModel>
                        <Listeners>
                            <RowDblClick Handler="SetWinData(rowIndex);" />
                        </Listeners>
                        <Plugins>
                            <ext:GridFilters runat="server" FiltersText="查找" ID="z00_kcxx_Filter">
                                <Filters>
                                    
								<ext:StringFilter DataIndex="ypid" />
								<ext:StringFilter DataIndex="ypgg" />
								<ext:StringFilter DataIndex="cjid" />
								<ext:StringFilter DataIndex="scph" />
								<ext:StringFilter DataIndex="lsjg" />
								<ext:StringFilter DataIndex="pfjg" />
								<ext:StringFilter DataIndex="gsid" />
								<ext:StringFilter DataIndex="jldw" />
								<ext:StringFilter DataIndex="sqsl" />
								<ext:StringFilter DataIndex="kcsl" />
								<ext:StringFilter DataIndex="lsj1" />
								<ext:StringFilter DataIndex="lsj2" />
								<ext:StringFilter DataIndex="lsj3" />
								<ext:StringFilter DataIndex="sxrq" />
								<ext:StringFilter DataIndex="bjrq" />
								<ext:StringFilter DataIndex="fjhm" />
								<ext:StringFilter DataIndex="hjhm" />
								<ext:StringFilter DataIndex="hjch" />
								<ext:StringFilter DataIndex="hjwh" />
								<ext:StringFilter DataIndex="sxbz" />
								<ext:StringFilter DataIndex="yxbz" />
								<ext:StringFilter DataIndex="djbz" />
								<ext:StringFilter DataIndex="fphm" />
								<ext:StringFilter DataIndex="pzwh" />
								<ext:StringFilter DataIndex="xzbz" />
								<ext:StringFilter DataIndex="sj" />
								<ext:StringFilter DataIndex="scpc" />

                                </Filters>
                            </ext:GridFilters>
                        </Plugins>
                        <LoadMask ShowMask="true" Msg="正在加载..." />
                        <SelectionModel>
                            <ext:CheckboxSelectionModel ID="CheckBoxGrid" runat="server" />
                        </SelectionModel>
                        <BottomBar>
                            <ext:PagingToolbar ID="PagingToolBar" StoreID="z00_kcxx_MainStore" PageSize="15" runat="server" />
                        </BottomBar>
                    </ext:GridPanel>
                </Items>
            </ext:FitLayout>
        </Items>
    </ext:Viewport>
    
    <!--z00_kcxx表修改，添加主窗体-->
    <ext:Window ID="z00_kcxx_Win" Collapsible="true" Hidden="true" Modal="true"
        Maximizable="true" runat="server" Title="添加/修改记录" Icon="WorldEdit" Width="630" AutoHeight="true"
        Resizable="true">
        <Items>
            <ext:Hidden ID="Hid" runat="server">
            </ext:Hidden>
            <ext:FormPanel ID="z00_kcxx_MainForm" LabelWidth="65" Frame="true" runat="server"
                Border="false" Height="450" Padding="5" Icon="UserAdd" Layout="Column">
                <Items>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items>
                            
							<ext:TextField ID="Txtypid" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ypid" />
							<ext:TextField ID="Txtcjid" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="cjid" />
							<ext:TextField ID="Txtlsjg" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="lsjg" />
							<ext:TextField ID="Txtgsid" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="gsid" />
							<ext:TextField ID="Txtsqsl" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="sqsl" />
							<ext:TextField ID="Txtlsj1" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="lsj1" />
							<ext:TextField ID="Txtlsj3" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="lsj3" />
							<ext:TextField ID="Txtbjrq" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="bjrq" />
							<ext:TextField ID="Txthjhm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hjhm" />
							<ext:TextField ID="Txthjwh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hjwh" />
							<ext:TextField ID="Txtyxbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="yxbz" />
							<ext:TextField ID="Txtfphm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="fphm" />
							<ext:TextField ID="Txtxzbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="xzbz" />
							<ext:NumberField ID="TxtNumgmp" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="gmp" />
							<ext:TextField ID="Txtscpc" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="scpc" />

                        </Items>
                    </ext:Panel>
                    <ext:Panel runat="server" Border="false" Header="false" ColumnWidth=".5" Layout="Form">
                        <Items> 
                            
							<ext:TextField ID="Txtypgg" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="ypgg" />
							<ext:TextField ID="Txtscph" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="scph" />
							<ext:TextField ID="Txtpfjg" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pfjg" />
							<ext:TextField ID="Txtjldw" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="jldw" />
							<ext:TextField ID="Txtkcsl" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="kcsl" />
							<ext:TextField ID="Txtlsj2" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="lsj2" />
							<ext:TextField ID="Txtsxrq" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="sxrq" />
							<ext:TextField ID="Txtfjhm" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="fjhm" />
							<ext:TextField ID="Txthjch" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="hjch" />
							<ext:TextField ID="Txtsxbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="sxbz" />
							<ext:TextField ID="Txtdjbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="djbz" />
							<ext:TextField ID="Txtpzwh" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="pzwh" />
							<ext:TextField ID="Txtsj" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="sj" />
							<ext:NumberField ID="TxtNumzbbz" AnchorHorizontal="92%" runat="server" AllowBlank="false" EmptyText="该项不可为空" FieldLabel="zbbz" />

                        </Items>
                    </ext:Panel>
                </Items>
            </ext:FormPanel>
        </Items>
        <Buttons> 
            <ext:Button Text="提交" ID="BtnSave" runat="server" Icon="Disk">
                <DirectEvents>
                    <Click OnEvent="BtnSave_Click">
                        <EventMask ShowMask="true" Msg="正在提交，请等候 ..."  />
                    </Click>
                </DirectEvents>
                <Listeners>
                    <Click Handler="if (#{z00_kcxx_MainForm}.getForm().isValid()) {;}else{Ext.Msg.show({icon: Ext.MessageBox.ERROR, msg: '您填写的信息不正确，请您确认！', buttons:Ext.Msg.OK});return false;}" />
                </Listeners>
            </ext:Button>
            <ext:Button Text="取消" ID="BtnConcel" Icon="Delete">
                <Listeners>
                    <Click Handler="#{z00_kcxx_Win}.hide();" />
                </Listeners>
            </ext:Button>
        </Buttons>
    </ext:Window>
    </form>
</body>
</html>
